﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Toplitz
{
    internal class Program
    {
        static void Main(string[] args)
        {
            List<List<int>> a = new List<List<int>>();
            while(true) 
            {
                string input = Console.ReadLine();
                if (string.IsNullOrEmpty(input))
                    break;
                List<int> row = new List<int>();
                string[] numbers = input.Split(new[] { ' ' });
                foreach(string number in numbers) 
                {
                    if (int.TryParse(number, out int val))
                    {
                        row.Add(val);
                    }
                }
                a.Add(row);
            }
            bool istoplitz = false;
            for(int i  = 0; i < a.Count; i++) 
            {
                for(int j = 0; j < a[i].Count; j++)
                {
                    if(i+1<a.Count && j+1 < a[i].Count && a[i][j] == a[i + 1][j+1])
                    {
                       istoplitz=true;
                        break;
                    }
                }
                if (istoplitz)
                    break;
            }
            Console.WriteLine(istoplitz ? "True" : "False");
        }
    }
}
